<template>
  <!-- 保证金明细 -->
  <el-dialog
    title="保证金明细"
    :visible.sync="dialogVisible"
    :close-on-click-modal="false"
    width="860px"
    append-to-body
  >
  <div class="table_box">
    <el-table
        :data="tableData.records"
        style="width: 100%"
        stripe
        border
      >
      <el-table-column
          prop="userName"
          label="名称"
        ></el-table-column>
        
        <el-table-column prop="amount" label="金额" >
        </el-table-column>
        <el-table-column
          prop="orderStatus"
          label="类型"
        >
        <template slot-scope="scope">
            <span v-show="scope.row.orderStatus==1">充值</span>
            <span v-show="scope.row.orderStatus==2">提现</span>
            <span v-show="scope.row.orderStatus==3">扣款</span>
        </template>
        </el-table-column>
        <el-table-column
          prop="payStatus"
          label="状态"
        >
        <template slot-scope="scope">
          <span v-if="scope.row.orderStatus==1">
            <el-tag type="warning" v-show="scope.row.payStatus==1">未支付</el-tag>
            <el-tag type="success" v-show="scope.row.payStatus==2">已完成</el-tag>
            <el-tag type="danger" v-show="scope.row.payStatus==3">已取消</el-tag>
          </span >
          <span v-else>
            <el-tag type="warning" v-show="scope.row.payStatus==1">审核中</el-tag>
            <el-tag type="success" v-show="scope.row.payStatus==2">已完成</el-tag>
            <el-tag type="danger" v-show="scope.row.payStatus==3">已拒绝</el-tag>
          </span>
            
        </template>
        </el-table-column>
        <el-table-column
          prop="createTime"
          label="时间"
        ></el-table-column>
        <el-table-column
          prop="remark"
          label="备注"
        ></el-table-column>
      </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

  </div>
  </el-dialog>
  
</template>
<script>
import { mapGetters } from "vuex";
import myMoneyApi from "@/api/financeCenter/myMoney.js";
export default {
  name: "",
  computed: {
    ...mapGetters(["userInfo"]),
  },
  data() {
    return {
      dialogVisible:false,
      timer:[],
      tableData:{
        records:[],
        
      },
      total:0,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        orderType:1
      },
    };
  },
  created() {
  },
  methods: {
    open(){
      this.dialogVisible = true
      this.getList()
    },
    // 获取列表
    getList() {
      // queryParams 请求列表
      this.loading = true;
      myMoneyApi.userPayOrderRecordList(this.queryParams).then((res) => {
        this.loading = false;
        this.tableData.records = res.rows;
        this.tableData.total = res.total;
      });
    },

   
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.timer = []
      this.handleQuery();
    },
    resetQuery() {
      this.timer = [];
      this.queryParams = {
        pageNum: 1,
        pageSize: 20,
        operatorTimeStart: "",
        operatorTimeEnd: "",
        dataType: "one",
        changeType:''
      };
      this.getList();
    },

    // 每页条数改变
    handleSizeChange(val) {
      this.queryParams.pageSize = val;
      this.getList();
    },
    // 页码改变
    handleCurrentChange(val) {
      this.queryParams.pageNum = val;
      this.getList();
    },
  }
};
</script>
<style lang="scss" scoped>
  .app-container{
    .search-box{
      // width: 790px;
      // margin: 0 auto;
    }
  }
</style>
